#导包
import app  #导入固定路径包
import unittest
from tools.HTMLTestRunner import HTMLTestRunner
from tpshop.scripts.test01 import testlogin
#封装测试套件
suite = app.BASE_DIR +'./scripts/' #使用固定路径的包
dic = unittest.defaultTestLoader.discover(suite, pattern='test01.py')
#指定测试报告
f = "./report/tpshop003.html"
#以文件流的形式打开文件
with open(f,'wb') as a:
    # 创建HTMLTestRunner的运行器
    runner = HTMLTestRunner(a, title='实验')
    # 执行测试套件
    runner.run(dic)
